import request from '@/config/axios'

export interface OutboundDeliveryVO {
  outboundDeliveryNumber: string
  outboundDeliveryPerson: string
  outboundDeliveryDate: string
  getMaterialsFormPerson: string
  children: ChildrenType[]
}

interface ChildrenType {
  id: number
  productNumber: string
  partNumber: string
  partName: string
  drawingNumber: string
  partSpecification: string
  material: string
  specification: string
  netSizeLength: number
  netSizeWidth: number
  cuttingSizeLength: number
  cuttingSizeWidth: number
  stockQuantity: number
  outboundDeliveryQuantity: number
  storageLocation: string
  dictUnit: number
  dictProcessName: number
  dictTypeOfWork: number
  dictBaitingType: number
  dictIsMachine: number
  dictMachiningProcess: number
  requirementTime: Date
  creatorName: string
  updaterName: string
}

// 查询外协管理 -- 外协入/出库 -- 外协出库列表
export const getOutboundDeliveryPage = async (params) => {
  return await request.get({ url: `/outsource/outbound-delivery/page`, params })
}

// 新增外协管理 -- 外协入/出库 -- 外协出库
export const createOutboundDelivery = async (data: OutboundDeliveryVO) => {
  return await request.post({ url: `/outsource/outbound-delivery-order/create`, data })
}

// 导出外协管理 -- 外协入/出库 -- 外协出库 Excel
export const exportOutboundDelivery = async (data) => {
  return await request.download({ url: `/outsource/outbound-delivery/export-excel`, data })
}
